# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=usbutils
pkgver=017
pkgrel=1
pkgdesc="USB Device Utilities"
url="https://linux-usb.sourceforge.net/"
arch="all"
license="GPL-2.0-or-later"
subpackages="$pkgname-doc $pkgname-dev"
depends="hwdata-usb"
makedepends="libusb-dev eudev-dev autoconf automake bash libtool linux-headers"
source="$pkgname-$pkgver.tar.gz::https://github.com/gregkh/usbutils/archive/refs/tags/v$pkgver.tar.gz
	hwdata.patch
	"

prepare() {
	default_prepare
	./autogen.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--datadir=/usr/share/hwdata \
		--disable-usbids \
		--disable-zlib
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
46fbeaa7459cc6a34cc4f1c6b124ea138636c756956bde66ed291e693ebbd9520cd4d4851c94bb0b1a3a1164f550a67f618fba1070bbbbdd55b6968191ebae91  usbutils-017.tar.gz
2d93f40bec3c9bd5a810b11449fbc1e8a7edbcd8bf4ca4ea8fd320eca81f31f0d8be1e886e0711fe18104d31c99f04aeb1e73970df3a2e40bfd50c17738c5b9d  hwdata.patch
"
